package com.ruoyi.labdanger.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.labdanger.domain.LabApplyOccupationDeliver;
import com.ruoyi.labdanger.mapper.LabApplyOccupationDeliverMapper;
import com.ruoyi.labdanger.service.ILabApplyOccupationDeliverService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 申领出库Service业务层处理
 *
 * @author ruoyi
 * @date 2022-03-22
 */
@Service
public class LabApplyOccupationDeliverServiceImpl implements ILabApplyOccupationDeliverService {
    @Autowired
    private LabApplyOccupationDeliverMapper labApplyOccupationDeliverMapper;

    /**
     * 查询申领出库
     *
     * @param id 申领出库ID
     * @return 申领出库
     */
    @Override
    public LabApplyOccupationDeliver selectLabApplyOccupationDeliverById(Long id) {
        return labApplyOccupationDeliverMapper.selectLabApplyOccupationDeliverById(id);
    }

    /**
     * 查询申领出库列表
     *
     * @param labApplyOccupationDeliver 申领出库
     * @return 申领出库
     */
    @Override
    public List<LabApplyOccupationDeliver> selectLabApplyOccupationDeliverList(LabApplyOccupationDeliver labApplyOccupationDeliver) {
        return labApplyOccupationDeliverMapper.selectLabApplyOccupationDeliverList(labApplyOccupationDeliver);
    }

    /**
     * 新增申领出库
     *
     * @param labApplyOccupationDeliver 申领出库
     * @return 结果
     */
    @Override
    public int insertLabApplyOccupationDeliver(LabApplyOccupationDeliver labApplyOccupationDeliver) {
        labApplyOccupationDeliver.setCreateTime(DateUtils.getNowDate());
        return labApplyOccupationDeliverMapper.insertLabApplyOccupationDeliver(labApplyOccupationDeliver);
    }

    /**
     * 修改申领出库
     *
     * @param labApplyOccupationDeliver 申领出库
     * @return 结果
     */
    @Override
    public int updateLabApplyOccupationDeliver(LabApplyOccupationDeliver labApplyOccupationDeliver) {
        return labApplyOccupationDeliverMapper.updateLabApplyOccupationDeliver(labApplyOccupationDeliver);
    }

    /**
     * 批量删除申领出库
     *
     * @param ids 需要删除的申领出库ID
     * @return 结果
     */
    @Override
    public int deleteLabApplyOccupationDeliverByIds(Long[] ids) {
        return labApplyOccupationDeliverMapper.deleteLabApplyOccupationDeliverByIds(ids);
    }

    /**
     * 删除申领出库信息
     *
     * @param id 申领出库ID
     * @return 结果
     */
    @Override
    public int deleteLabApplyOccupationDeliverById(Long id) {
        return labApplyOccupationDeliverMapper.deleteLabApplyOccupationDeliverById(id);
    }
}
